package com.sl.au.service.impl;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.stereotype.Service;

import com.sl.au.service.AccountsReceivableTotalService;

@Service("AccountsReceivableTotalService")
public class AccountsReceivableTotalServiceImpl implements AccountsReceivableTotalService {

	@PersistenceContext
	private EntityManager em;
	
	@Override
	public List getPayPlanChartsService(int queryType, String beginDate, String endDate, String deptName) {
		return this.em.createNativeQuery("{call getPayPlanChart(?,?,?,?)}")
				.setParameter(1, queryType)
				.setParameter(2, beginDate)
				.setParameter(3, endDate == null ? "" : endDate)
				.setParameter(4, deptName == null ? "" : deptName)
				.getResultList();
	}

}
